import 'package:flutter/material.dart';
import 'package:chat_shop/common/const/cosnt.dart';

// extension NormalAppbar on AppBar {
class CustomAppbar {
  static AppBar normal({String? title, Widget? leading, Function()? onPress, List<Widget>? action}) {
    return AppBar(
      centerTitle: true,
      backgroundColor: AppColor.mainColor,
      title: Text(title ?? ''),
      leading: leading == null
          ? IconButton(
              padding: const EdgeInsets.all(0),
              icon: Icon(Icons.arrow_back_ios),
              onPressed: onPress,
            )
          : leading,
      actions: action,
    );
  }
}
